package com.agile.leetcode.redis.redisson.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;

/**
 * redisson客户端的配置
 *
 * @Author KD
 * @Date 2021/1/22 13:34
 */
public class RedissionConfig {
    public static RedissonClient redissonClient;

    /**
     * 获取
     *
     * @return
     */
    public static RedissonClient getRedissonClient() {
        Config config = new Config();
        config.useSingleServer()
                .setTimeout(1000)
                .setAddress("redis://localhost:6379");
        redissonClient = Redisson.create(config);
        return redissonClient;
    }
}
